const deepCopy = (value: any) => {
  if (value instanceof Function) return value
  else if (value instanceof Array) {
    const newValue = [] as any
    for (let i = 0; i < value.length; ++i) newValue[i] = deepCopy(value[i])
    return newValue
  } else if (value instanceof Object) {
    const nnewValue = {} as any
    for (const i in value) nnewValue[i] = deepCopy(value[i])
    return nnewValue
  } else return value
}
export default deepCopy
